import 'es6-promise/auto'
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        getMenus:[],
        itemMenu: [{
                'title': '首页',
                'name': 'home'
            }, {
                'title': '采购申请',
                'name': 'purchaseApply'
            }, {
                'title': '新增采购',
                'name': 'purchaseApply_add'
            }

        ],
        activeItem : 0

    },
    mutations: {
        pushItemMenu: function(state, thisItem) {
            state.itemMenu = state.itemMenu.concat(thisItem)
            // console.log(state.itemMenu)
        },
        delItemMenu:function(state, thisItem){
           
        },
        curActive:function(state,thisActive){
            state.activeItem = thisActive
        }

    }
})

export default store
